<?php

/**
 * author: Shenzhongchao
 * createTime: 2019/12/27
 *
 */
define( 'ROOT_PATH', __DIR__ );

require_once( ROOT_PATH . '/tickets_data/Tickets.php');

$f_s = htmlspecialchars($_GET['f_s']);
$t_s = htmlspecialchars($_GET['t_s']);
$date = htmlspecialchars($_GET['date']);

$fromStation = trim($f_s);
$toStation = trim($t_s);
$date = trim($date);

$tickets = new Tickets($fromStation, $toStation, $date);
$json = $tickets->run();

//将PHP变量(数组或对象)转换为JSON数据
echo json_encode($json);
